import java.io.FileInputStream;
        import java.io.ObjectInputStream;
        import java.io.ObjectOutputStream;
        import java.util.List;
        import java.util.function.ObjIntConsumer;

public class ObjectStreamTest {
    public static void main(String[] args)throws Exception {
        ObjectInputStream ois = new ObjectInputStream(new FileInputStream("Students"));
        Object o = ois.readObject();
       List l =  (List) o;
       for (Object s : l) {
           System.out.println(s);
       }
    }
}
